/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.order.service.TuangouOrderService
   Module Description   :

   Date Created      : 2011/8/27
   Original Author   : feeling.wang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.order.service;

import java.io.Serializable;
import java.util.Map;

import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.order.entity.Orders;
import com.yaodian100.ec.shopping.entity.CartOrders;

/**
 * 集购卖场订单
 * 
 * @author feeling.wang
 * 
 */
public interface TuangouOrderService extends DomainService<Orders> {
	/**
	 * 判断会员是否可买集购商品
	 * 
	 * @param tuangouId 集购卖场编号
	 * @param memberId 会员编号
	 * @return
	 * @throws CoreException
	 */
	public boolean canBuy(Long tuangouId, String memberId) throws CoreException;

	/**
	 * @param oid
	 * @return
	 * @throws CoreException
	 */
	public CartOrders getTuangouCartOrders(Serializable oid) throws CoreException;

	/**
	 * @param memberId
	 * @param cartId
	 * @return
	 * @throws CoreException
	 */
	public CartOrders getTuangouCartOrders(String memberId, String cartId) throws CoreException;

	/**
	 * @param entity
	 * @return
	 * @throws CoreException
	 */
	public CartOrders saveTuangouCartOrders(CartOrders entity) throws CoreException;

	/**
	 * 新增集购卖场商品资料
	 * 
	 * @param memberId 会员编号
	 * @param cartId 购物车编号
	 * @param productId 商品编号
	 * @param specId 规格编号
	 * @param qty 数量
	 * @return
	 * @throws CoreException
	 */
	public CartOrders addTuangouProduct(String memberId, String cartId, String productId, Long specId, int qty)
			throws CoreException;

	/**
	 * 建立集购卖场购物车
	 * 
	 * @param memberId 会员编号
	 * @return
	 * @throws CoreException
	 */
	public CartOrders createTuangouCart(String memberId) throws CoreException;

	public Orders createTuangouOrderWithPay(CartOrders cart, Map<String, String> addonInfo, Map<String, String> payment)
			throws CoreException;

	public boolean isInteger(String input);

	public boolean isInteger2(String input);

}